package c.e.a.b.f.b;

import android.os.SystemClock;
import android.util.Pair;
import c.e.a.b.a.a.a.a;
import c.e.a.b.b.j.c;
import c.e.a.b.e.c.v8;
import java.math.BigInteger;
import java.util.Locale;
import java.util.Objects;

/* compiled from: com.google.android.gms:play-services-measurement@@18.0.0 */
public final class q8 extends i9 {
    public String d;
    public boolean e;
    public long f;

    public q8(k9 k9Var) {
        super(k9Var);
    }

    public final boolean p() {
        return false;
    }

    public final Pair<String, Boolean> s(String str, d dVar) {
        if (!v8.a() || !this.a.g.o(p.J0) || dVar.j()) {
            return u(str);
        }
        return new Pair("", Boolean.FALSE);
    }

    @Deprecated
    public final String t(String str) {
        g();
        str = (String) u(str).first;
        if (t9.x0() == null) {
            return null;
        }
        return String.format(Locale.US, "%032X", new Object[]{new BigInteger(1, r0.digest(str.getBytes()))});
    }

    @Deprecated
    public final Pair<String, Boolean> u(String str) {
        String str2 = "";
        g();
        Objects.requireNonNull((c) this.a.n);
        long elapsedRealtime = SystemClock.elapsedRealtime();
        if (this.d != null && elapsedRealtime < this.f) {
            return new Pair(this.d, Boolean.valueOf(this.e));
        }
        c cVar = this.a.g;
        Objects.requireNonNull(cVar);
        this.f = elapsedRealtime + cVar.n(str, p.b);
        try {
            a b = c.e.a.b.a.a.a.b(this.a.a);
            String str3 = b.a;
            this.d = str3;
            this.e = b.b;
            if (str3 == null) {
                this.d = str2;
            }
        } catch (Exception e) {
            d().m.b("Unable to get advertising id", e);
            this.d = str2;
        }
        return new Pair(this.d, Boolean.valueOf(this.e));
    }
}
